<?php

namespace App\Models\api;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class House extends Model
{
    use HasFactory;
    protected $table = 'house';
    protected $guarded = [];
    protected $hidden = ['deleted_at'];

    public function IntermediaryUser()
    {
        return $this->hasOne(IntermediaryUser::class,'id','intermediary_id');
    }

    public function direction()
    {
        return $this->hasOne(HouseAttr::class,'id','house_direction');
    }
    //住房类型
    public function propertyType()
    {
        return $this->hasOne(HouseAttr::class,'id','house_property_type');
    }
    //几室几厅
    public function houseRoom()
    {
        return $this->hasOne(HouseAttr::class,'id','house_room');
    }
    //建筑年代
    public function houseYear()
    {
        return $this->hasOne(HouseAttr::class,'id','house_year');
    }
    public function city()
    {
        return $this->hasOne(City::class,'id','house_region');
    }
}
